/*
 * @Date: 2025-02-10 17:47:33
 * @LastEditors: zl 1077167261@qq.com
 * @LastEditTime: 2025-02-10 17:51:10
 * @FilePath: \vue-admin\src\store\modules\menu.js
 */
import { routes, resetRouter } from "@/router";

export default {
  namespaced: true,
  state() {
    return {
      menuList: [...routes],
    };
  },
  mutations: {
    setMenuList(state, filterRoutes) {
      state.menuList = [...routes, ...filterRoutes];
    },
    resetMenu(state) {
      // 重置左侧菜单
      state.menuList = routes;
      // 重置路由系统
      resetRouter();
    },
  },
};
